#pragma once

#include "transform3d.h"
#include <QObject>
#include <QtGui>


class QOpenGLContext;
class Camera;


class LampProg : public QObject, public Transform3D
{
    Q_OBJECT

public:
    explicit LampProg(QObject *parent = nullptr);
    virtual ~LampProg();

    const QVector3D& lampColor() const {return lampColor_;}

    virtual void initializeGL(QOpenGLContext* ctx, void* arg, size_t argLen);
    virtual void paintGL(const Camera& camera, const QMatrix4x4& projection) = 0;

signals:
    void dataChanged();

public slots:
    void setLampColor(const QVector3D& color);
    void setLampColor(float r, float g, float b) {lampColor_ = QVector3D(r, g, b);}

protected slots:
    virtual void teardownGL();

protected:
    QOpenGLContext* contex;
    QVector3D       lampColor_;
};
